import React, { useState, useImperativeHandle } from 'react';
import {
  List,
  InputItem,
  DatePicker,
  TextareaItem,
  Checkbox,
  Button,
} from 'antd-mobile';
import SelfInput from 'components/common/selfInput';
import Cascade from 'components/common/cascade';
import Star from 'components/common/star';
import SelfCheckBox from 'components/common/selfCheckBox';
import companyType from 'dic/companyType';
import SelfRadio from 'components/common/selfRadio';

import './index.less';

export default function CompConnInfo({ item, cRef }) {
  const [address, setaddress] = useState('')
  const [linkMan, setlinkMan] = useState('')
  const [linkPhone, setlinkPhone] = useState('')
  useImperativeHandle(cRef, () => ({
    address,
    linkMan,
    linkPhone
  }))

  return (
    <>
      <SelfInput
        label="单位地址"
        isRequired={true}
        rule={{
          len: 1,
          empty: '请输入单位地址',
          error: '请正确输入单位地址',
        }}
        handleInputChange={(v) => setaddress(v)}
      />
      <SelfInput
        label="联系人"
        isRequired={true}
        rule={{
          len: 1,
          empty: '请输入联系人',
          error: '请正确输入联系人',
        }}
        handleInputChange={(v) => setlinkMan(v)}
      />
      <SelfInput
        label="联系电话"
        isRequired={true}
        rule={{
          len: 1,
          empty: '请输入联系电话',
          error: '请正确输入联系电话',
        }}
        type='phone'
        handleInputChange={(v) => setlinkPhone(v)}
      />
    </>
  );
}
